<?php
namespace App\Http\Controllers\Kaoshi;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Session;
class   KaoshiController extends Controller {
    public function login(){
        return view('Kaoshi.login');
    }
    public function logins(){
//        var_dump($_POST);
        $name = $_POST['name'];
        $pwd = $_POST['pwd'];
        $info = DB ::table('ks_login')->where('name',$_POST['name'])->first();
        if($info){
            echo 1;
        }else {
            echo 2;
        }
    }
    public function shows(){
        $info = DB::table('ks_meet')->get();
        return view('Kaoshi.shows',['info'=>$info]);
    }
    public function del(){
        $id = $_GET['id'];
        $info = DB ::table('ks_meet')->where(['id'=>$id])->delete($id);
//        var_dump($info);die;
        if($info){
            echo 200;
        }else {
            echo 100;
        }
    }
}